package org.github.manx98.jlibhac.tools.ncm;

import lombok.Data;
import org.github.manx98.jlibhac.common.math.Uint64;
import org.github.manx98.jlibhac.fs.IStorage;
import org.github.manx98.jlibhac.tools.fssystem.ncautils.TitleVersion;

import java.io.IOException;

/**
 * @author Manx98
 * @version 1.0
 * @since 2022/10/6 18:37
 */
@Data
public class CnmtContentMetaEntry {
    private final Uint64 TitleId;
    private final TitleVersion Version;
    private final ContentType Type;

    public CnmtContentMetaEntry(IStorage reader) throws IOException {
        TitleId = reader.readUint64();
        Version = new TitleVersion(reader.readUint32(), true);
        Type = ContentType.valueOf(reader.readByte());
        reader.setPosition(reader.getPosition() + 3);
    }
}
